meson: gdk: wayland: generate private wayland headers first
authorTim-Philipp Müller <tim@centricular.com>
Mon, 20 Mar 2017 11:44:42 +0000 (11:44 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 3 May 2017 14:10:54 +0000 (15:10 +0100)
gdkprivate-wayland.h includes generated wayland client protocol
headers and is included from gdkdisplaymanager.c, so we need to
generate those client protocol headers first also when building
main gdk itself.

gdk/meson.build
gdk/wayland/meson.build

index 5b91e8a1df0b2298824da0a8deb763baba3af193..fda09e843a857139d115a4d6ac1601ad4ee42caa 100644 (file)
@@ -179,16 +179,22 @@ if wayland_enabled or broadway_enabled
 endif
 
 gdk_backends = []
+gdk_backends_gen_headers = []  # non-public generated headers
 foreach backend : ['broadway', 'wayland', 'x11', 'mir']
   if get_variable('@0@_enabled'.format(backend))
     subdir(backend)
     gdk_deps += get_variable('gdk_@0@_deps'.format(backend))
     gdk_backends += get_variable('libgdk_@0@'.format(backend))
+    # Special-case this for now to work around Meson bug with get_variable()
+    # fallback being an empty array, or any array (#1481)
+    if backend == 'wayland'
+      gdk_backends_gen_headers += get_variable('gdk_@0@_gen_headers'.format(backend))
+    endif
   endif
 endforeach
 
 libgdk = static_library('gdk',
-  sources: [gdk_sources, gdkconfig],
+  sources: [gdk_sources, gdk_backends_gen_headers, gdkconfig],
   c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
   include_directories: [confinc, xinc, wlinc],
   link_with: gdk_backends,
index d1a96b620c4bf81f85d31a3cf4b120232af43aad..b0d20ec4731fe975103c2f3ac23b11a7071e3fe0 100644 (file)
@@ -64,12 +64,14 @@ proto_sources = [
    join_paths(proto_dir, 'unstable/tablet/tablet-unstable-v2.xml')],
 ]
 
+gdk_wayland_gen_headers = []
+
 # FIXME: there's some protostability/protoname stuff in Makefile.am I don't grok
 foreach p : proto_sources
   output_base = p[0]
   input = p[1]
 
-  gdk_wayland_sources += custom_target('@0@ client header'.format(output_base),
+  gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
     input : input,
     output : '@0@-client-protocol.h'.format(output_base),
     command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'client-header'])
@@ -81,7 +83,7 @@ foreach p : proto_sources
 endforeach
 
 libgdk_wayland = static_library('libgdk-wayland',
-  gdk_wayland_sources, gdkconfig, gdkenum_h,
+  gdk_wayland_sources, gdk_wayland_gen_headers, gdkconfig, gdkenum_h,
   include_directories: [confinc, gdkinc],
   c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
   dependencies: [gdk_deps, gdk_wayland_deps])